﻿@using LotteryVoteMVC.Core
@using LotteryVoteMVC.Core.Application
@using LotteryVoteMVC.Models
@using LotteryVoteMVC.Resources
@using LotteryVoteMVC.Utility
@model PagedList<BetOrder>
@{
    ViewBag.Title = @Resource.CancelList;
    Layout = "~/Views/Shared/Main.cshtml";
}
@section Header
{
    <script src="@Url.Content("~/Scripts/Customer/SearchHelper.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.ui.datepicker.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.ui.datepicker-" + CultureHelper.GetCurrentCulture() + ".js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Customer/TableBase.js")" type="text/javascript"></script>
    <link href="@Url.Content("~/Content/themes/base/jquery.ui.theme.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/themes/base/jquery.ui.datepicker.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/TableBase.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/Pager/pagerGray.css")" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        $(document).ready(function () {
            $("#Date").attr("readonly", "readonly").datepicker();
        });
    </script>
}
@{
    int index = 1;
}
<div id="searchBar">
    @using (Html.BeginForm())
    {
        <span>@Resource.Time</span>
        @Html.TextBox("Date")
        <span>@Resource.Company</span>
        @Html.Action("TodayCompany","Partial")
        <span>@Resource.GameType</span>
        @Html.Action("GamePlayWay", "Partial")
        <span>@Resource.Num</span>
        @Html.TextBox("Num")
        <input type="submit" name="search" id="search" value="@Resource.Search" />
    }
</div>
<table>
    <thead>
        <tr>
            <td>
                @Resource.No
            </td>
            <td>
                @Resource.SheetNum
            </td>
            <td>
                @Resource.UserName
            </td>
            <td>
                @Resource.Num
            </td>
            <td>
                @Resource.Company
            </td>
            <td>
                @Resource.GameType
            </td>
            <td>
                @Resource.Amount
            </td>
            <td>
                @Resource.Turnover
            </td>
            <td>
                @Resource.Odds
            </td>
            <td>
                @Resource.Commission
            </td>
            <td>
                @Resource.Net
            </td>
            <td>
                @Resource.NetAmount
            </td>
            <td>
                @Resource.CreateTime
            </td>
            <td>
                @Resource.CancelTime
            </td>
        </tr>
    </thead>
    <tbody>
        @foreach (var order in Model)
        { 
            <tr>
                <td>
                    @(index++)
                </td>
                <td>
                    @order.OrderId
                </td>
                <td>
                    @order.UserName
                </td>
                <td>
                    <strong>
                        @order.Num
                    </strong>
                </td>
                <td>
                    @LotterySystem.Current.FindCompany(order.CompanyId).Name
                </td>
                <td>
                    @Extended.GetGPWDescription(order.GamePlayWayId)
                </td>
                <td>
                    @order.Amount.ToString("N")
                </td>
                <td>
                    @order.Turnover.ToString("N")
                </td>
                <td>
                    @order.Odds
                </td>
                <td>
                    @order.Commission.ToString("N")
                </td>
                <td class="@(order.DropWater > 0 ? "red" : string.Empty)">
                    @order.Net.ToString("N")
                </td>
                <td>
                    @order.NetAmount.ToString("N")
                </td>
                <td>
                    @order.CreateTime
                </td>
                <td>
                    @order.CancelTime
                </td>
            </tr>
        }
    </tbody>
</table>
@Html.Pager(Model)
